package com.kgc.ebook.ebookmanager.controller;

import com.kgc.ebook.ebookmanager.pojo.Category;
import com.kgc.ebook.ebookmanager.pojo.ResultEntity;
import com.kgc.ebook.ebookmanager.service.Categoryservice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@RestController
public class CategoryController {

    @Resource
    Categoryservice categoryservice;

    @RequestMapping("/getCategoryList")
    public ResultEntity<List<Category>> getCategoryList(){
        List<Category> categoryList = categoryservice.selectAll();
        return ResultEntity.successWithoutData(categoryList);
    }

}
